package com.ys.erp.stage_user_service.controller;

import com.ys.erp.framework.annotation.CheckEmpLogin;
import com.ys.erp.framework.annotation.ResponseResult;
import com.ys.erp.framework.annotation.StageLoginEmp;
import com.ys.erp.framework.bean.dto.StageEmpDTO;
import com.ys.erp.stage_user_service.bean.condition.UserContractCondition;
import com.ys.erp.stage_user_service.bean.vo.UserContractVO;
import com.ys.erp.stage_user_service.service.UserContractService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequiredArgsConstructor
@RequestMapping("/manage/user/contract")
@Tag(name = "用户合同相关接口", description = "用户合同相关接口")
@ResponseResult
public class UserContractController {

    private final UserContractService userContractService;

    @PostMapping("/listUserContract")
    @Operation(summary = "用户合同集", description = "用户合同集")
    @CheckEmpLogin
    public List<UserContractVO> listUserContract(@RequestBody @Valid UserContractCondition.ListContractCon con,
                                     @StageLoginEmp StageEmpDTO empDto) {
        return userContractService.listUserContract(empDto, con);
    }

}
